import request from '@/utils/request'

// 列表
export function getList(params) {
  return request({
    url: 'departments',
    method: 'get',
    params
  })
}
// 新增
export function addList(params) {
  return request({
    url: 'departments',
    method: 'post',
    params,
    msg: true
  })
}

// 详情
export function editList(id) {
  return request({
    url: 'departments/' + id,
    method: 'get'
  })
}

// 编辑
export function saveList(id, params) {
  return request({
    url: 'departments/' + id,
    method: 'put',
    params,
    msg: true
  })
}

// 删除
export function delList(id) {
  return request({
    url: 'departments/' + id,
    method: 'delete',
    msg: true
  })
}
